struct head {
	/*
	unsigned char reserve:1;//保留字段
	unsigned char qos:1;//QOS质量
	unsigned char hasdata:1;//是否有数据
	unsigned char compress:1;//数据是否压缩
	*/
	uint8_t type:8;
};

struct connect {
	uint8_t type:8;
	uint8_t proto_ver:8;
	EccPoint cli_pub_key;
	uint8_t cli_random[NUM_ECC_DIGITS];
	//start enc data
	uint8_t userid:8;
};

enum type {
	RETAIN = 0,
	CONNECT = 1,
	CONNACK = 2,
};
